﻿using CNKI.TPI.Web.Search.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace CNKI.TPI.Web.Admin.IBLL
{
    /// <summary>
    /// 
    /// </summary>
    public interface IUserCenterService
    {
        /// <summary>
        /// 获取检索数据
        /// </summary>
        /// <param name="DBname"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="startIndex"></param>
        /// <param name="pagecount"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        DataTable GetSearchPage(string DBname, DateTime? startDate, DateTime? endDate, int startIndex, int pagecount, out int count);

        /// <summary>
        /// 获取检索数据
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="DBname"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="startIP"></param>
        /// <param name="endIP"></param>
        /// <returns></returns>
        DataTable GetSearchPage(string userid, string DBname, DateTime? startDate, DateTime? endDate, string startIP, string endIP);

        /// <summary>
        /// 获取浏览数据
        /// </summary>
        /// <param name="DBname"></param>
        /// <param name="title"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="startIndex"></param>
        /// <param name="pagecount"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        DataTable GetViewPage(string DBname, string title, DateTime? startDate, DateTime? endDate, int startIndex, int pagecount, out int count);

        /// <summary>
        /// 获取浏览数据
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="DBname"></param>
        /// <param name="title"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="startIP"></param>
        /// <param name="endIP"></param>
        /// <returns></returns>
        DataTable GetViewPage(string userid, string DBname, string title, DateTime? startDate, DateTime? endDate, string startIP, string endIP);

        /// <summary>
        /// 获取下载数据
        /// </summary>
        /// <param name="DBname"></param>
        /// <param name="title"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="startIndex"></param>
        /// <param name="pagecount"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        DataTable GetDownPage(string DBname, string title, DateTime? startDate, DateTime? endDate, int startIndex, int pagecount, out int count);

        /// <summary>
        /// 获取下载数据
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="DBname"></param>
        /// <param name="title"></param>
        /// <param name="startDate"></param>
        /// <param name="endDate"></param>
        /// <param name="startIP"></param>
        /// <param name="endIP"></param>
        /// <returns></returns>
        DataTable GetDownPage(string userid, string DBname, string title, DateTime? startDate, DateTime? endDate, string startIP, string endIP);

        /// <summary>
        /// 获取收藏分类类别
        /// </summary>
        /// <returns></returns>
        DataTable GetFavoriteCategory(int startIndex, int pagecount, out int count);

        /// <summary>
        /// 获得用户分类列表
        /// </summary>
        /// <returns></returns>
        DataTable GetFavoriteCategory();

        /// <summary>
        /// 新增分类数据
        /// </summary>
        /// <param name="catename"></param>
        /// <param name="catestatus"></param>
        /// <returns></returns>
        bool InsertFavoriteCategory(string catename, int catestatus);

        /// <summary>
        /// 更新分类名称
        /// </summary>
        /// <param name="catename"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        bool UpdateFavoriteCategoryName(string catename, int id);

        /// <summary>
        /// 更新分类顺序
        /// </summary>
        /// <param name="sortno"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        bool UpdateFavoriteCategorySort(int sortno, int id);

        /// <summary>
        /// 删除分类
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DelFavoriteCategory(int id);

        /// <summary>
        ///判断分类名称是否重复
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        int IsExistFavName(string name);

        /// <summary>
        /// 新增收藏记录
        /// </summary>
        /// <param name="favCateID"></param>
        /// <param name="dbCode"></param>
        /// <param name="dbName"></param>
        /// <param name="recid"></param>
        /// <param name="recTitle"></param>
        /// <returns></returns>
        bool InsertFavoriteFolder(int favCateID, string dbCode, string dbName, string recid, string recTitle);

        /// <summary>
        /// 获取收藏列表
        /// </summary>
        /// <returns></returns>
        DataTable GetFavoriteFolder(int catid, string dbname, string title, DateTime? startDate, DateTime? endDate, int startIndex, int pagecount, out int count);

        /// <summary>
        /// 更新收藏记录
        /// </summary>
        bool UpdateFavoriteFolder(int favCateID, int floderid);

        /// <summary>
        /// 删除收藏记录
        /// </summary>
        bool DelFavoriteFolder(string floderid);
        /// <summary>
        /// 取消收藏
        /// </summary>
        /// <param name="recid"></param>
        /// <returns></returns>
        bool UpdateFavStatusByRecID(int recid);
        /// <summary>
        /// 根据数据库code获取该数据库的收藏记录
        /// </summary>
        /// <param name="dbcode"></param>
        /// <returns></returns>
        DataTable GetFavFolderList(string dbcode);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbid"></param>
        /// <param name="dbCode"></param>
        /// <param name="searchType"></param>
        /// <param name="searchLogID"></param>
        /// <param name="searchQueryList"></param>
        /// <param name="clsID"></param>
        /// <param name="categoryNodeCode"></param>
        /// <param name="order"></param>
        void GetSingleSearchLogDetail(string dbid, string dbCode, SearchType searchType, int searchLogID, IList<SearchQuery> searchQueryList, out int clsID, out string categoryNodeCode, out string order);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="searchLogID"></param>
        /// <param name="searchQueryList"></param>
        /// <param name="order"></param>
        /// <param name="classCode"></param>
        /// <param name="dbid"></param>
        void GetMultiSearchLogDetail(int searchLogID, IList<SearchQuery> searchQueryList, out string order, out string classCode, out string dbid);
    }



}
